package org.zhao.nettydemos.protocol;

/**
 * @Auther: xiaohui.zhao
 * @Date: 2021/9/16 18:31
 * @Description:
 */
public class ProtobufDemo {

    public static MsgProtos.Msg buildMsg(){
        MsgProtos.Msg.Builder builder = MsgProtos.Msg.newBuilder();
        builder.setId(1000);
        builder.setContent("张三李四");

        MsgProtos.Msg message = builder.build();
        return message;
    }

    public static MsgProtos.Msg buildMsg(int id,String content){
        MsgProtos.Msg.Builder builder = MsgProtos.Msg.newBuilder();
        builder.setId(id);
        builder.setContent(content);

        MsgProtos.Msg message = builder.build();
        return message;
    }

}